Skip to content

Cherry pick PR #9203: cobalt: Disable resource load throttling#9252

Open
cobalt-github-releaser-bot wants to merge 4 commits intomainfrom
cherry-pick-main-9203
Open

Cherry pick PR #9203: cobalt: Disable resource load throttling#9252
cobalt-github-releaser-bot wants to merge 4 commits intomainfrom
cherry-pick-main-9203

Conversation

@cobalt-github-releaser-bot
Copy link
Collaborator

Refer to the original PR: #9203

Cobalt operates as a single-tab application, which eliminates the
need for resource load throttling. In multi-tab browser environments,
throttling can manage resources or prioritize active tabs, but in
Cobalt, it provides no benefit and may hinder performance.

This change configures ResourceLoadScheduler::IsClientDelayable to
always return false for Cobalt builds. This ensures that all resource
requests are treated as non-delayable and processed without artificial
delays.

Bug: 484394054

Cobalt operates as a single-tab application, which eliminates the
need for resource load throttling. In multi-tab browser environments,
throttling can manage resources or prioritize active tabs, but in
Cobalt, it provides no benefit and may hinder performance.

This change configures ResourceLoadScheduler::IsClientDelayable to
always return false for Cobalt builds. This ensures that all resource
requests are treated as non-delayable and processed without artificial
delays.

Bug: 484394054
(cherry picked from commit 0470089)
@cobalt-github-releaser-bot
Copy link
Collaborator Author

MERGE CONFLICT CAT

Caution

There were merge conflicts while cherry picking! Check out cherry-pick-main-9203 and fix the conflicts before proceeding. Check the log at https://github.com/youtube/cobalt/actions/runs/22411131814 for details.

@github-actions
Copy link
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Disable Resource Load Throttling

Cobalt operates as a single-tab application. Resource load
throttling, used in multi-tab environments to manage resources
or prioritize tabs, provides no benefit and can hinder
performance in Cobalt. This change configures
ResourceLoadScheduler::IsClientDelayable to always return false
for Cobalt builds, treating all resource requests as non-delayable.

Bug: 484394054

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@zhongqiliang zhongqiliang marked this pull request as ready for review February 25, 2026 19:02
@zhongqiliang zhongqiliang requested a review from a team as a code owner February 25, 2026 19:02
@zhongqiliang zhongqiliang enabled auto-merge (squash) February 25, 2026 19:03
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a cherry-pick that disables resource load throttling for Cobalt builds. The implementation in resource_load_scheduler.cc correctly uses a build flag to modify behavior for Cobalt, which is appropriate. However, the corresponding change in BUILD.gn unconditionally comments out a test file. This could lead to a loss of test coverage for non-Cobalt builds if the codebase is used in other contexts. I've left a comment with a suggestion for a more robust, conditional approach to maintain test integrity across different build configurations.

Comment on lines 242 to 243
# resource_load_schedule is disabled, see b/484394054
# "fetch/resource_load_scheduler_test.cc",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a minor typo in the comment: schedule should be scheduler.

More importantly, commenting out this test file removes it unconditionally for all builds. If this source tree is only ever used for Cobalt builds, this is acceptable. However, if there's a possibility of non-Cobalt builds, this will silently disable tests and could hide regressions.

A more robust method would be to conditionally exclude the file using the is_cobalt build flag (or its equivalent) in GN. For example:

  if (!is_cobalt) {
    sources += [ "fetch/resource_load_scheduler_test.cc" ]
  }

This would ensure tests run for non-Cobalt configurations. Please consider this for better long-term maintenance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it would be better to conditionally exclude the file using is_cobalt. Can you instead please add something like this around line 263?

if (is_cobalt) {
  # resource_load_schedule is disabled, see b/484394054
  sources -= [ "fetch/resource_load_scheduler_test.cc" ]
}

Copy link
Contributor

@hlwarriner hlwarriner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from the one open comment thread.

Comment on lines 242 to 243
# resource_load_schedule is disabled, see b/484394054
# "fetch/resource_load_scheduler_test.cc",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it would be better to conditionally exclude the file using is_cobalt. Can you instead please add something like this around line 263?

if (is_cobalt) {
  # resource_load_schedule is disabled, see b/484394054
  sources -= [ "fetch/resource_load_scheduler_test.cc" ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants